<template>
    <div class="Manage">
        <top/>
        <div class="content">
            <div class="left">
                <p @click="$router.push('/worker')">管理界面</p>
                <ul>
                    <li  @click="$router.push('/worker/findOrder')" >订单处理</li>
                    <li @click="$router.push('/worker/printOrder')" >打印订单</li>
                    <li @click="$router.push('/worker/checkIn')" >借阅登记</li>
                    <li @click="$router.push('/worker/finish')" >配送确认</li>
                    <li @click="$router.push('/worker/history')"  >订单历史</li>
                    <li @click="$router.push('/worker/user')">用户管理</li>
                    <li @click="$router.push('/worker/updateInfo')">信息修改</li>
                    <li @click="$router.push('/worker/updatePwd')">密码修改</li>
                </ul>
            </div>
            <div class="right">
                <div v-if="$router.currentRoute.fullPath === '/worker'" class="welcome">
                    <img src="../../../assets/my-lib-index-top.jpg">
                    <p>{{$vals.name}},您好！</p>
                    <ul>
                        <li>待处理订单：{{nums.handler}}</li>
                        <li>待找书订单：{{nums.find}}</li>
                        <li>待登记订单：{{nums.register}}</li>
                        <li>待配送订单：{{nums.distribute}}</li>
                    </ul>
                </div>
                <router-view/>
            </div>
        </div>
        <bottom/>
    </div>
</template>

<script>
    export default {
        props: {},
        data(){
            return{
                // 统计数字
                nums:{}
            }
        },
        created() {
            this.$noLogin(()=>{
                // 获取订单统计信息
                this.$axios.get('/order/admin-statistic').then(res=>{
                    if (res.data.code === 200){
                        this.nums = res.data.content;
                    }
                })
            },  () => {
                this.$router.push('/login');
            });

        },
    };
</script>

<style lang="scss" scoped>
    @import "Manage";
</style>
